<template>
  <div class="main-box">
    <BaseTable :request="request" ref="baseTable">
      <el-table-column prop="id" label="ID" width="120px" />
      <el-table-column prop="username" label="用户名" />
      <el-table-column prop="user_id" label="会员ID" />
      <el-table-column prop="ip" label="登录IP" />
      <el-table-column prop="login_address" label="登录地址" />
      <el-table-column prop="agent" label="客户端" />
      <el-table-column prop="desc" label="描述" />
      <el-table-column prop="create_time" label="添加时间" />
      <el-table-column :label="$t('操作')" width="200px" fixed="right">
        <template slot-scope="scope">
          <DelBtn @success="delUserLog(scope.row)" />
        </template>
      </el-table-column>
    </BaseTable>
  </div>
</template>
<script>
import userApi from '@/api/users.js'
export default {
  data() {
    return {
      request: userApi.userLoginLog
    }
  },
  methods: {
    delUserLog(row) {
      userApi.delUserLoginLog({ id: row.id }).then(res => {
        if (res.code == 0) {
          this.$message.success(res.msg)
          this.$refs.baseTable.getList(type)
        }
      })
    }
  }
}
</script>
